package com.learn.demo.netty.rpc.customer;

import com.learn.demo.netty.rpc.netty.NettyClient;
import com.learn.demo.netty.rpc.publicserver.HelloService;
import lombok.extern.slf4j.Slf4j;

/**
 * 客户端启动类
 *
 * @author banjiawei
 * @date 2022/03/11
 */
@Slf4j
public class ClientBootStrap {
    private static final String providerName = "HelloServer#sayHello#";
    public static void main(String[] args) {
        //创建一个消费者
        NettyClient nettyClient = new NettyClient();
        HelloService helloService = (HelloService) nettyClient.getBean(HelloService.class, providerName);
        String result = helloService.sayHello("你好，服务器");
        log.info("调用的结果为:{}", result);
    }
}
